]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
St: Use a local material template
authorAdel Gadllah <adel.gadllah@gmail.com>
Mon, 13 Sep 2010 22:00:34 +0000 (00:00 +0200)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 13 Sep 2010 22:00:34 +0000 (00:00 +0200)
To be consistent with what we do with the shadow
material, use the same pattern in setup_framebuffer().

src/st/st-theme-node-transition.c

index e523c5ce32729e395415b74c6ca9980d0017cf7a..319cea7c336699138823442c6847bc0e606112bb 100644 (file)
@@ -55,9 +55,6 @@ struct _StThemeNodeTransitionPrivate {
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-/* template material to avoid unnecessary shader compilation */
-static CoglHandle global_material = COGL_INVALID_HANDLE;
-
 G_DEFINE_TYPE (StThemeNodeTransition, st_theme_node_transition, G_TYPE_OBJECT);
 
 
@@ -215,6 +212,9 @@ setup_framebuffers (StThemeNodeTransition *transition,
   CoglColor clear_color = { 0, 0, 0, 0 };
   guint width, height;
 
+  /* template material to avoid unnecessary shader compilation */
+  static CoglHandle material_template = COGL_INVALID_HANDLE;
+
   width  = priv->offscreen_box.x2 - priv->offscreen_box.x1;
   height = priv->offscreen_box.y2 - priv->offscreen_box.y1;
 
@@ -249,24 +249,24 @@ setup_framebuffers (StThemeNodeTransition *transition,
 
   if (priv->material == NULL)
     {
-      if (G_UNLIKELY (global_material == COGL_INVALID_HANDLE))
+      if (G_UNLIKELY (material_template == COGL_INVALID_HANDLE))
         {
-          global_material = cogl_material_new ();
+          material_template = cogl_material_new ();
 
-          cogl_material_set_layer_combine (global_material, 0,
+          cogl_material_set_layer_combine (material_template, 0,
                                            "RGBA = REPLACE (TEXTURE)",
                                            NULL);
-          cogl_material_set_layer_combine (global_material, 1,
+          cogl_material_set_layer_combine (material_template, 1,
                                            "RGBA = INTERPOLATE (PREVIOUS, "
                                                                "TEXTURE, "
                                                                "CONSTANT[A])",
                                            NULL);
-          cogl_material_set_layer_combine (global_material, 2,
+          cogl_material_set_layer_combine (material_template, 2,
                                            "RGBA = MODULATE (PREVIOUS, "
                                                             "PRIMARY)",
                                            NULL);
         }
-      priv->material = cogl_material_copy (global_material);
+      priv->material = cogl_material_copy (material_template);
     }
 
   cogl_material_set_layer (priv->material, 0, priv->new_texture);